<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>房产历史欠费信息明细</title>
<LINK href="images/css.css" type="text/css" rel="stylesheet">
<style type="text/css" media="print">
.noprint {
	display: none;
}
</style>
<script type="text/javascript">
	 
</script>
</head>

<body>
<table width="100%" height="420" border="0" align="center">
<tr valign="middle"><td>
<table width="100%" border="0">
	<tr align="center">
		<td><c:if test="${showSummary eq 0}">
			<strong><font size="+2">湖北康正物业服务有限公司业主历史欠费通知单</font></strong>
		</c:if> <c:if test="${showSummary eq 1}">
			<strong><font size="+2">湖北康正物业服务有限公司专用收据</font></strong>
		</c:if></td>
	</tr>
	<tr>
		<td>
		<table width="100%" border="1" align="right" cellpadding="0"
			cellspacing="0" bordercolor="#000000">
			<tr align="center">
				<td><b>小区名称</b></td>
				<td><b>${house.building.subDistrict.name}&nbsp;</b></td>
				<td><b>房产编号</b></td>
				<td><b>${house.houseId }&nbsp;</b></td>
				<td><b>业主</b></td>
				<td><b>${house.owner.name }&nbsp;</b></td>
				<td><b>缴费月份</b></td>
				<td><b>2013年9月之前</b></td>
			</tr>
			<tr align="right">
				<td width="18%"><b>收费项目</b></td>
				<td width="12%"><b>起码数</b></td>
				<td width="12%"><b>止码数</b></td>
				<td width="18%"><b>数量(平米/度/吨)</b></td>
				<td width="13%"><b>收费标准(元)</b></td>
				<td width="13%"><b>金额(元)</b></td>
				<td colspan="2" align="center"><b>备注</b></td>
			</tr>
			<c:if test="${!empty recordList}">
				<c:forEach items="${recordList}" var="record">
					<tr align="right">
						<td><c:choose>
							<c:when test="${record.chargeItem.itemId eq '2'}">
								物业服务费
							</c:when>
							<c:otherwise>
								${record.chargeItem.name }
							</c:otherwise>
							</c:choose>
						</td>
						<c:choose>
							<c:when test="${record.chargeItem.itemId eq '1'}">
								<td>&nbsp;</td>
								<td>&nbsp;</td>
								<td height="25"><fmt:formatNumber value="${house.area }"
									pattern="#.00" />&nbsp;</td>
							</c:when>
							<c:when test="${record.chargeItem.itemId eq '2'}">
								<td>&nbsp;</td>
								<td>&nbsp;</td>
								<td height="25">1.0&nbsp;</td>
							</c:when>
							<c:when test="${record.chargeItem.itemId eq '3'}">
								<td>${powerBegin }&nbsp;</td>
								<td>${powerEnd }&nbsp;</td>
								<td height="25">${powerVolume }&nbsp;</td>
							</c:when>
							<c:when test="${record.chargeItem.itemId eq '4'}">
								<td>${waterBegin }&nbsp;</td>
								<td>${waterEnd }&nbsp;</td>
								<td height="25">${waterVolume }&nbsp;</td>
							</c:when>
							<c:when test="${record.chargeItem.itemId eq '8'}">
								<td>${waterBegin }&nbsp;</td>
								<td>${waterEnd }&nbsp;</td>
								<td height="25">${waterVolume }&nbsp;</td>
							</c:when>
							<c:otherwise>
								<td>&nbsp;</td>
								<td>&nbsp;</td>
								<td height="25">1&nbsp;</td>
							</c:otherwise>
						</c:choose>
						<td><fmt:formatNumber
							value="${record.chargeCriterion.amount }" pattern="0.00" />&nbsp;</td>
						<td><fmt:formatNumber value="${record.wantMoney }"
							pattern="#.00" />&nbsp;</td>
						<td colspan="2">&nbsp;</td>
					</tr>
				</c:forEach>
			</c:if>
			<tr align="right">
				<td align="center">合计</td>
				<td align="left" colspan="4">(大写)&nbsp;&nbsp;&nbsp;${amountUpperCase }&nbsp;</td>
				<td align="right">(小写)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="red"><fmt:formatNumber
					value="${bill.amount }" pattern="#.00" />&nbsp;</font></td>
				<td colspan="2">&nbsp;</td>
			</tr>
		</table>
		</td>
	</tr>
</table>
<div id="summary"
	<c:if test="${showSummary eq 0}">
  		style="margin-top:10px;margin-left:5px;display:none;font-size:12px;"
  	</c:if>
	<c:if test="${showSummary eq 1}">
  		style="margin-top:10px;margin-left:5px;display:block;font-size:12px;"
  	</c:if>>
	<div>
		历史欠款：<fmt:formatNumber value="${historyDebt}" pattern="0.00" />&nbsp;&nbsp;
		违约金：0.00&nbsp;&nbsp;
		预缴金额：0.00&nbsp;&nbsp;
		应缴金额：<fmt:formatNumber value="${bill.amount }" pattern="#.00" />&nbsp;&nbsp;
        本次付费：<fmt:formatNumber value="${bill.amount }" pattern="#.00" />&nbsp;&nbsp;
		预存费用：<fmt:formatNumber value="${smallChange}" pattern="0.00" />&nbsp;&nbsp;
	</div>
	<div style="margin-top: 5px;">
		账户余额：<fmt:formatNumber value="${balance }" pattern="#.00" />&nbsp;&nbsp;
		收费员：${nickname}&nbsp;&nbsp;
		抄表员：${nickname}&nbsp;&nbsp;
		开票员： ${nickname}&nbsp;&nbsp;
		开票日期：${invoiceDate }</div>
	</div>

	<div id="printDiv" class="noprint"
		style="text-align: right; margin-top: 10px; margin-right: 10px; font-size: 14px;">
		<c:if test="${showSummary eq 0}">
			<a href="#" onclick="javascript:window.print()">打印明细</a> |
		    </c:if> <c:if test="${showSummary eq 1}">
			<a href="#" onclick="javascript:window.print()">打印收据</a> | 
		   	</c:if> <c:if test="${bill.isPaid eq 0}">
			<a href="bill.do?method=pay&id=${bill.id }">账单支付</a>
		</c:if> <c:if test="${bill.isPaid eq 1}">账单已付</c:if>
	</div>
</td>
</tr>
</table>
</body>
</html>